Ext.define('NF.view.farm.LivestockDetails', {
    extend:'Ext.tab.Panel',
    itemId:Ext.id('livestockDetails'),
    alias:'widget.livestockDetails',
    layout:'fit',
    initComponent:function(){
        var tabs = this;
        this.items = [
            {
                xtype: 'lactationDetails',
                closable:false,
                itemId:Ext.id('lactationDetails'),
                context:tabs.context
            },
            {
                xtype: 'feedDetails',
                closable:false,
                itemId:Ext.id('feedDetails'),
                context:tabs.context,
                listeners:{
                    'activate':function(thisComponent,options){
                        if(!thisComponent.activatedAtleastOnce){
                            thisComponent.prepareGrid();
                            thisComponent.activatedAtleastOnce = true;
                        }
                    }
                }
            },
            {
                xtype: 'expenseDetails',
                closable:false,
                itemId:Ext.id('expenseDetails'),
                context:tabs.context
            },
            {
                xtype: 'revenueDetails',
                closable:false,
                itemId:Ext.id('revenueDetails'),
                context:tabs.context
            },
            {
                xtype: 'checkupDetails',
                closable:false,
                itemId:Ext.id('vaccinationDetails'),
                context:tabs.context,
                listeners:{
                    'activate':function(thisComponent,options){
                        if(!thisComponent.activatedAtleastOnce){
                            thisComponent.prepareGrid();
                            thisComponent.activatedAtleastOnce = true;
                        }
                    }
                }
            },
            {
                xtype: 'calveDetails',
                closable:false,
                itemId:Ext.id('calveDetails'),
                context:tabs.context
            },
            {
                xtype: 'medicalHistoryDetails',
                closable:false,
                itemId:Ext.id('medicalHistoryDetails'),
                context:tabs.context
            }
        ];
        this.callParent(arguments);
    }
});